<script>
    /*用户-删除*/
    function del(obj, id) {
        layer.confirm('确认要删除吗？',
            function (index) {
                // 发异步删除数据
                $.get("{:url('delete')}?id=" + id, function (res) {
                    if (res.code == 0) {
                        $(obj).parents("tr").remove();
                        layer.msg('已删除!', {
                            icon: 1,
                            time: 1000
                        });
                    } else {
                        layer.alert(res.msg, {icon: 2});
                    }
                }, 'json');
            });
    }
</script>
